Method for synchronizing a local time base on a central time base and device for implementing said method with preferred applications

ABSTRACT

Time messages are transmitted from a central timebase to a local timebase. The transmission time of a time message is detected and is entered as a data value in a subsequent time message. The reception time of a time message is detected, and the transmission time contained in it is reproduced, by the local timebase. Finally, the difference between associated transmission and reception times of time messages is used to determine the time discrepancies occurring in the process, and these are evaluated for synchronization of the local timebase.

This application is the national phase under 35 U.S.C. § 371 of PCTInternational Application No. PCT/DE99/00712 which has an Internationalfiling date of Mar. 15, 1999, which designated the United States ofAmerica.

FIELD OF THE INVENTION

The invention relates to a method for synchronization of at least onelocal timebase in a local technical system to a central timebase in acentral technical system. The invention also relates to an apparatus forcarrying out the method, and to preferred uses of the apparatus.

In this case, the local timebase may correspond to the timing in a localdata processing device, and the central timebase may correspond to thetiming in a central data processing device. Data records are transmittedfrom the central data processing device to the local data processingdevice and thus from the central timebase to the local timebase, timebase data records contain time information and, in some circumstances,also other payload data of widely differing types. These data recordsare referred to, for short, as “time messages” in the following text.

BACKGROUND OF THE INVENTION

As a rule, the local processing of data in the local data processingdevice is carried out on the basis of the local timebase. This is formedin the respective local data processing device in particular by means ofso-called timer modules. These are generally counters which aredecremented cyclically by a local clock transmitter, emit a trigger ortime-transmitter signal for the respective local timebase whenever theyare completely decremented, that is to say whenever the counter contentspass through zero.

In automation engineering, local data processing devices may be used fordecentralized control of distributed technical equipment which, as acomponent of a production facility which in some circumstances iscomplex, impinges, for example, on the machining of a workpiece or theprocessing of a raw material. By way of example, as one of many possibleexamples of such technical equipment, electrical drives may bementioned, which are in each case supplied with data from an associatedlocal data processing device; this may also be referred to as a drivecontroller. In the example, such data are largely control variables,that is to say, in particular, measured values, set values and settings.

For the operability of the entire production facility, for example a CNCmachine tool, it is now generally necessary for the technical equipmentof such a facility to act in a coordinated fashion on, for example, aworkpiece or a raw material. This is in turn dependent on the localtimebases in the local data processing devices of the technicalequipment being synchronized to one another. This ensures that, forexample, actual values are detected simultaneously by the local dataprocessing devices and, for example, control signals are outputsimultaneously to the associated technical equipment. All the local dataprocessing devices involved in a production facility thus act at theinstant of a corresponding processing state on the respective workpieceor raw material in terms of metrology and control engineering.

Furthermore, regular, renewed synchronization of the local timebases inthe local data processing devices is necessary. The reason for this isthe associated local, in particular crystal-controlled, clocktransmitters in the timer modules. These have different scatters betweenthe units in the various local data processing devices and thus have adifferent long-term drift behavior. Thus, the local timebases wouldgradually drift apart from one another without regular synchronization.

In a first, known system, the local data processing devices can besupplied via a separate clock line with a fixed, central control clockfor synchronization of the local timebases. This central control clockis supplied directly to the clock transmitter for the respective timermodule. Such an arrangement is particularly complex, since the separateclock line must be routed in parallel with a data bus which is generallypresent in any case and connects the local data processing devices to acentral data processing device.

For synchronization of local timebases in local data processing devices,they may also be connected via a data bus to a central data processingunit in which a central database is formed and maintained. In this case,in a known system of this type, so-called “clock messages” aretransmitted from the central timebase to the local timebases, where theyare evaluated for synchronization. However, a disadvantage that occursin this case is that the clock messages must be supplied at strictlyequidistant times from the central data processing unit to the data bus.These clock messages are received by a specific evaluation circuit inthe local data processing devices, in particular by a PLL (phase lockedloop) evaluation circuit. This PLL evaluation circuit derives acorrection signal from the reception timing of the equidistant clockmessages, and this is used to readjust the clock transmitter which actson the respective timer module, in order to synchronize the localtimebase. Synchronization using clock messages at strictly equidistanttimes is also referred to as hard synchronization.

A major disadvantage with such a system is that separate hardware in theform of an evaluation circuit is required in each local data processingdevice to receive and evaluate the clock messages which are strictly atequidistant times. A further disadvantage is that, in practice, it isoften impossible to comply precisely with the requirement for strictlyequidistant timing, for example owing to a particular type of datatransmission on the respective data bus or, for example, owing tointerrupt-dependent processing delays in the central data processingunit. This leads to fluctuations, in particular delays, in the timing ofthe clock messages, is also referred to as jitter. In somecircumstances, this jitter propagates into the local timebases and cancause equidistant fluctuations in lower-level fine control clocks in therespective local data processing device.

SUMMARY OF THE INVENTION

The invention is based on the object of specifying a method and anapparatus for synchronization of local timebases with as littleadditional circuit complexity as possible being required at the localdata processing device end.

According to the method of the present invention, the transmission timeof a so-called “time message” is detected by the central timebase and isentered as a data value in a subsequent time message. The reception timeof a time message is then detected, and the value of the transmissiontime contained in a time message is reproduced by a local timebase.Finally, measured values for the time discrepancy between the localtimebase and the central timebase are determined by the local timebasefrom the difference between associated transmission and reception timesof time messages. These time discrepancy values are evaluated forsynchronization of the local timebase.

The invention is based on evaluation of the reception of time messagesand the use of time information contained in them for synchronization ofthe local timebases. On the one hand, time stamps are transmitted withthe time messages, in particular in the form of the transmission timesof previous time messages. However, with regard to the invention, thetime messages need in no way be used exclusively for transmission ofsuch time information. In fact, the time messages may furthermore alsocontain any desired further payload data which is in no way linked tothe synchronization of the timebases. The term time message thusexpresses the fact that this is a data message which also contains timeinformation which is produced by the central timebase.

Furthermore, the detection of the actual time discrepancies, accordingto the invention, between the central timebase and local timebase withthe aid of time messages makes it possible to compensate for theoccurrence of jitter both at the central timebase end, that is to sayvirtually at the transmission end, and at the local timebase end, thatis to say virtually at the reception ends. Such jitter may have widelydiffering causes and, for example, may be due to transmissioninterference between the central timebase and the local timebases, orfluctuations in internal processing times in the central timebase or alocal timebase, which are dependent on software processes, for exampleinterrupts. The capability to compensate for such fluctuations accordingto the invention is based on detecting, transmitting and evaluating thevalues of the respective exact transmission time and of the exactreception time of each time message as accurately as possible is to sayit is based on the detection of the time discrepancy associated withthem, which discrepancies are in turn a measure of the differencebetween the central timebase and the local timebase. In this way, alocal timebase is supplied with a high-precision and robust timemeasurement, i.e one that is independent of jitter.

Thus, although the method according to the invention requires regulartransmission of time messages, there is no need for clock messages to betransmitted at strictly equidistant times. The time messages are thusdata messages which also include time information relating to an exacttransmission time. The synchronization method according to the inventionis furthermore so robust that, even in an exceptional situation, anindividual time message may even be lost without endangering thesynchronism of the local timebases.

In a further advantageous embodiment of the method according to theinvention, time discrepancies are determined by the local timebase withthe aid of a group of time messages which have been transmitted duringan observation period. Finally, a correction value is formed from theminimum value of the time discrepancies detected in an observationperiod, and is used for synchronization. In this embodiment, a group oftime messages is thus first of all evaluated at a local timebase end,and the time discrepancies derived from this are effectively, collated.Finally, only that time discrepancy which has the best characteristic isselected for correction. This is the minimum value of the timediscrepancies since, specifically, this is linked to a time messagewhich has been subject to the least interference from jitter in theprevious observation period, i.e the one which is closest to the idealstate of a virtually undelayed data transmission.

According to a further advantageous embodiment of the method accordingto the invention, a correction value corresponds to the initial value ofa control algorithm, to which the value zero is supplied as the setvalue, and to which the minimum value of the time discrepancies in anobservation period is supplied as the actual value. On the one hand,this embodiment effectively further increases the “softness” of theapplication of correction values to a local timebase, i.e and inparticular application to the timer modules of an associated local dataprocessing unit.

Finally, the use of a control algorithm for determining a correctionvalue makes it possible for the method according to the invention to beimplemented virtually completely with the aid of software routines whichrun in the local data processing unit having the respective localtimebase. The respective correction value may thus be determined purelyby software then just needs to be loaded as a new start value in thetimer module of the local data processing unit. Such a start value mayalso be referred to a reload value. This is associated with the furtheradvantage that a preferably crystal-operated clock transmitter, whichdecrements the timer module of a local data processing unit, remainscompletely uninfluenced, and can run freely. The method according to theinvention is thus not applied to the clock transmitter of a timermodule, but to the timer module itself. Thus, according to theinvention, the local timebase is updated by reprogramming anappropriately selected start value for the timer module. The startvalue, also called the reload value, is thus dynamically matched.Furthermore, this reprogramming is independent of the clock and can thusbe carried out at any time, that is to say “on the fly”.

According to a further advantageous embodiment of the invention, acorrection value is applied in a distributed manner by a local timebaseduring a subsequent observation period. This “soft”, i.e step-by-step,application of a correction value allows a further reduction to beachieved in the influence of jitter on the synchronization quality. Thesynchronization method according to the invention is thus highlyaccurate and does not require any separate clock lines.

The values which are obtained by the evaluation according to theinvention of the transmission and reception times of time messages andwhich are referred to as the “time discrepancy” and are an image of theactual discrepancy between a local timebase and the central timebase.They may thus be used for correction of the local timebase, i.e tosynchronize it, without using any associated local clock transmitters.The value of a time discrepancy is in this case governed essentially bytwo elements, in which case the first element may be regarded as a“drift element” and the second element as a “jitter element”. The “driftelement” is caused by discrepancies between the central timebase and thelocal timebase, which are in turn caused by component tolerances, inparticular in the generally crystal-operated clock transmitters for therespective timebase. The “jitter element” is essentially caused bydifferent processing times, in particular of the time messages in thecentral timebase and the local timebase, for example in the respectiveconnections to the data buses of the associated central and local dataprocessing units and, possibly, also by delay time differences, whichmay be only minor, on the data bus between the data processing units.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention, further advantageous embodiments of it, and furtheradvantages linked to it will be explained in more detail in thefollowing text with reference to the exemplary embodiments which areillustrated in the figures, which are described briefly below and inwhich:

FIG. 1 shows a block diagram of an exemplary arrangement, including acentral data processing apparatus and two local data processingapparatuses with a data bus via which time messages are transmittedaccording to the invention,

FIG. 2 shows an example of a schematic illustration in the form of atwo-dimensional timing diagram to explain the way in which thesynchronization method according to the invention operates,

FIG. 3 shows an example of a schematic flowchart to explain theprocessing steps between the communication algorithm and thesynchronization algorithm according to the present invention, at thecentral data processing apparatus end,

FIG. 4 shows a further example of a schematic flowchart to explain theprocessing steps between the communication algorithm and thesynchronization algorithm according to the present invention, at thelocal data processing apparatus end,

FIG. 5 shows an example of the determination of a minimum value from thetime discrepancies detected during an observation period, according toone advantageous development of the invention, and

FIG. 6 shows, schematically, an exemplary embodiment of the inventionfor determining and applying a correction value, derived from the timediscrepancies, for the local timebase in a local data processingapparatus.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

FIG. 1 shows an advantageous arrangement, in the form of an example of ablock diagram, which is suitable for carrying out the method accordingto the invention. The arrangement contains a central data processingdevice 1, which is also referred to as a “master” and, by way ofexample, two local data processing devices 14 and 15, which are alsoreferred to as the “slave m” and “slave n”. All the data processingdevices are connected one another via an external data bus 10, whereindata messages are transmitted with time information, that is to say timemessages, from the central data processing device 1 to the local dataprocessing devices 14 and 15. In the example in FIG. 1, three successivetime messages 11, 12 and 13 are shown by way of example from a stream ofmessages which follow one another at regular intervals and are alsoreferred to as time messages Zn−1, Zn and Zn+1. As data information,each time message 11, 12, 13 contains the value of the transmission timex, y, z of a previous time message. As has already been explained above,any desired other payload data may also be included, which is notrelated to the transmission of time information. This will be explainedin more detail with reference to the next figure, FIG. 2.

The central data processing device 1 has central device for forming acentral timebase tz. This is advantageously a timer module 6, which isactuated by a clock transmitter 7 and, for example, is decremented. Thetimer module 6 emits a timing signal for the local timebase tz for eachcomplete decrementation, i.e. for each zero crossing of its countervalue. The timer module is then once again loaded with a constant startvalue, which is referred to as “RR const.”. The timer module 6 isconnected via an internal data bus 3 to other elements in the centraldata processing device 1. The example in FIG. 1 shows a centralprocessing unit 2, known as the “CPU master”, a memory 5 for data and abus connection 4, via which the internal data bus 3 is connected to theexternal data bus 10. Apart from a communication algorithm 8 which isprocessed by the central processing unit 2, the bus connection 4 is acomponent of a central communication unit. Their task is to feed datamessages, in particular in the form of time messages, on to the centraldata bus 10.

The time messages themselves are formed by a central synchronizationdevice which, in the example in FIG. 1, are represented by a centralsynchronization algorithm 9, which is likewise processed by the centralprocessing unit 2. Since the transmission time of a time message can nolonger be entered in this message itself as a data value, one of thesubsequent time messages is used as a medium for this time information.The next time message is preferably used as the medium. Thus, in themethod according to the invention, the transmission time of a timemessage which has been supplied is detected, temporarily stored andentered as a data value in a subsequent time message, before it is fedin. In the examples illustrated in FIGS. 1 to 6, it is assumed that thetime message Zn+1 with the reference symbol 13 contains the transmissiontime z of the preceding time message Zn with the reference symbol 12 asa data value. Further time message Zn with the reference symbol 12contains the transmission time y of the previous time message Zn−1 withthe reference symbol 11 as a data value.

The two local data processing devices 14 and 15 shown by way of examplein FIG. 1 are of identical construction and a local unit for forming alocal timebase, tm and tn respectively. These local unit preferablyrespectively include a timer module 24 and 34, which are decrementedcyclically by a clock 25 and 35, respectively. A timing signal for thelocal timebase tm or tn, respectively, is emitted by the timer modules24 and 34, respectively, for each complete decrementation. The timermodules are then once again loaded with a start value, which is referredto as “RR dyn.”. This is a so-called “dynamic reload value” which isformed in accordance with an advantageous embodiment of the inventionand which, according to the invention, is matched to the respectivelocal timebase for synchronization, using at least one time discrepancythat has been determined. This will be explained in more detail in thefollowing text.

The timer modules 25 and 35, respectively, are connected via an internaldata bus 20 or 30, respectively, to further elements in the respectivelocal data processing device 14 or 15, respectively. In the example inFIG. 1, a local processing unit 19 or 29, respectively, called “CPUSlave m” or “CPU Slave n”, respectively, a memory 23 or 33,respectively, for data and a bus connection 21 or 31, respectively, arepresent via which the respective internal data bus 20 or 30 is connectedto the external data bus 10. Apart from a respective communicationalgorithm 26 or 36, which are respectively processed by the respectivelocal processing unit 19 or 29, the bus connections 21 and 31 arecomponents of a central communication unit. These have the task ofreceiving time messages from the central data bus 10.

The time messages themselves are evaluated by local synchronizationmeans, which are represented in the example in FIG. 1 by a respectivelocal synchronization algorithm 27 or 37, which is likewise processed bythe respective local processing unit 2. According to the invention, theactual reception times of time messages are in this case detected, thetransmission times (which are contained in the received time messages asdata values) of time messages are read, and the time discrepancies aredetermined from associated transmission and reception times of timemessages. Finally, correction values “RR dyn.” are determined from thisfor the local unit for producing the local timebase tm or tn. If timermodules 24 and 34, respectively, are preferably once again used as localunit or producing the local timebase tm or tn, then the localsynchronization algorithms 27 or 37, respectively, apply the correctionvalue “RR dyn.” as the start value to the respective timer module. Thiswill be explained in more detail in the following text, in particularwith reference to the example in FIG. 6.

In the example in FIG. 1, the respective internal data buses 20 and 30have a further bus connection, which is designated as a drive connection22 or 32, respectively. This allows data links to be produced to atechnical production facility 16, by way of example. In FIG. 1, the twolocal data processing devices 14 and 15, respectively, are used, by wayof example, to operate local technical equipment 17 or 18, respectively,in the technical production facility 16. The technical equipmentincludes for example, electrical drives 17 and 18. In this case, thelocal data processing device 14 or 15, respectively, actuates the localtechnical equipment 17 or 18, respectively, in time with the respectivelocal timebase tm or tn. In this case, control variables are preferablyinterchanged in time with the respective local timebase tm or tn betweenthe local data processing device 14 or 14, respectively, and theassociated local technical equipment 17 or 18, respectively, inparticular digitized actual values, set values and/or settings 17 a, 17b and 18 a, 18 b, respectively. These variables are processed in thedecentralized processing unit 28 or 38 [lacuna] local data processingdevice 14 or 15, respectively. A symbolic control algorithm 28 or 38,respectively, in the local processing unit 19 or 29, respectively, isused by way of example for this purpose in FIG. 1. If the localtimebases tm and tn are synchronized according to the invention, thenthe interchange of the control variables relating to the same initialstate takes place in the interior of the production facility 16, and thecontrol algorithms 28 and 38, respectively, complete the respectivecalculations on the basis of a matching situation.

FIG. 2 shows a two-dimensional timing diagram illustrated schematically,by way of example. This will be used in the following text to explainthe way in which the synchronization method according to the inventionoperates.

On the left-hand side of the timing diagram, there is a first group ofthree vertical time axes 49, 50 and 51, which are associated with thecentral data processing device 1 (master). In this case, the time axis49 shows the time profile in the central timebase tz, the time axis 50shows the action times in the central synchronization algorithm 9, andthe time axis 51 shows the data processing steps in the centralcommunication algorithm 8. On the right-hand side of the timing diagram,there is a second group of three further vertical time axes 52, 53 and54, which are associated with a local data processing device, forexample the local data processing device 15 (slave n). In this case, thetime axis 52 shows the time profile in the local timebase tn, the timeaxis 53 shows the action times in the local synchronization algorithm37, and the time axis 54 shows the data processing steps in the localcommunication algorithm 36. The transmission of the examples of timemessages Zn−1, Zn and Zn+1 on the data bus 10 is symbolized by obliquearrows 11, 12 and 13, running from left to right, between the two groupsof time axes.

The sequence of data processing steps and action times for theindividual algorithms will be explained in detail in the following textusing the example of the timing diagram shown in FIG. 2.

The times 55, 56, 57 and 58 annotated by diamonds on the time axis 49represent time markers for the central timebase tz. These preferablycorrespond to those times at which, in the example in FIG. 1, the timermodule 6 in the central data processing device 15 is in each case loadedwith a new start value, that is to say a reload value RR const. In orderto form the central timebase tz, the timer module 6 is decrementedcyclically by a clock 7. After each complete decrementation, a timingsignal is emitted for the central timebase tz. Finally, a new startvalue RR const. is applied to the timer module 6. At the same time, thecentral synchronization algorithm 9 is called up at each of the times55, 56, 57 and 58, respectively, as is symbolized in FIG. 2 by obliquearrows 39, 42, 45 and 48, respectively, running from left to right.These branch at action times 9 a, 9 c and 9 e of the synchronizationalgorithm. The action time associated with the arrow 48 is no longershown on the lower edge of FIG. 2, in order to make the illustrationclearer.

At the action times 9 a, 9 c and 9 e, respectively, the temporarilystored transmission time x, y or z, respectively, of the most recentlytransmitted time message is activated, and is passed on to the centralcommunication algorithm 8. This is once again symbolized by obliquearrows 40, 43 and 46, respectively, running from left to right. Thisenters the respective transmission time x, y or z in a data processingstep 8 aa, 8 ba or 8 ca, respectively, into a time message Zn−1, Zn orZn+1, respectively, which is then fed into the data bus 10. Preferablyafter completion of the respective feeding process, the actualtransmission time y, z or a, respectively, of the time message Zn−1, Znor Zn+1 currently being transmitted is detected with respect to the timeaxis 49 of the central timebase tz in a further data processing step 8ab, 8 bb or 8 cb, respectively, and is passed on to the centralsynchronization algorithm 9. This is symbolized by oblique arrows 41, 44and 47, respectively, which run from right to left and branch atcorresponding action times 9 b, 9 d and 9 f, respectively, on the timeaxis 50 of the central synchronization algorithm 9. The measured valuesof the actual transmission times y, z and a, respectively, are storedthere in order to make it possible to take them into account, after therespective time marked by the time marker 56, 57 or 58, respectively, onthe time axis 49 of the central timebase tz, as a data value of therespective subsequent time message Zn, Zn+1 . . . .

The time messages 11, 12 and 13, respectively, fed into the data bus 10are received in the example in FIG. 2 by the local communicationalgorithm 36 of the local data processing device 15 (slave n) at theaction times 36 a, 36 b and 36 c, respectively. Preferably aftercompletion of the respective data reception process, the actualreception time u, v or w, respectively, of the time message Zn−1, Zn orZn+1 currently being received is detected with respect to the time axis52 of the local timebase tn in a further data processing step 36 aa, 36ba or 36 ca, respectively. Further the respective transmission time x, yor z contained as a data value in the respective time message isreconstructed. Both values, i.e the transmission times of the previoustime message and the reception time of the present time message, areavailable in data processing steps 36 ab, 36 bb and 36 cb. These arepassed on in pairs to the local synchronization algorithm 37, as issymbolized by oblique arrows 66, 68 and 70, respectively, which run fromleft to right and are inscribed x, u; y, v and z, w respectively. Thesebranch at corresponding action times 37 a, 37 b and 37 c on the timeaxis 53 of the local synchronization algorithm 37. According to theinvention, [lacuna] are formed, virtually as measured values for thetime discrepancies, from the difference between associated transmissionand reception times of time messages in these action times. According topreferred embodiments of the invention, a correction value, or acorrection value split into partial correction values, is derived fromthis for synchronization of the local timebase tn.

A correction value or partial correction value is preferably taken intoaccount actively, or for the purpose of synchronization, at the times59, 60, 61 and 62, respectively, annotated by diamonds on the time axis52 of the local timebase tn. In the example in FIG. 2, the associatedtime discrepancies (x-s), (u-y) and (v-z), which are evaluated as thebasis for synchronization, are indicated symbolically alongside thetimes 60, 61 and 62, respectively.

Furthermore, by way of example, the example in FIG. 2 shows so-calledjitter 63 at the transmission end, and so-called jitter 64 at thereception end. These are time delays which occur due to irregular andunpredictable delays in instruction processing at the transmission end,i.e in the processing unit 2 of the central data processing apparatus 1,and at the reception end, for example, in the processing unit 29 of thelocal data processing apparatus 15. In the example in FIG. 2, the dataprocessing step 8 ba is delayed by the jitter 63, i.e the transmissionof the time message Zn, on the other hand the transmission of the timemessages Zn and Zn+1 in the comparable data processing steps 8 aa and 8ca on the time axis 51 of the central communication algorithm 8 takesplace with virtually no delay. Furthermore, the data processing step 36cb is delayed by the jitter 64, i.e the reception of the time messageZn+1, on the other hand the reception of the time messages Zn−1 and Znin the comparable data processing steps 36 ab and 36 bb on the time axis54 of the local communication algorithm 36 takes place with virtually nodelay. The advantage of the invention is that such sporadic delays havevirtually no influence on the quality of the synchronization of thetimebases in the local data processing apparatuses. The present value ofany jitter is detected, and taken into account in the synchronization aswell, by means of the measured value of any time discrepancy.

In one advantageous embodiment of the invention, which has already beenillustrated in the example in FIG. 1, the local data processingapparatus 15 may have a local unit for forming the local timebase tn ineach case having a timer module 34 which is decremented cyclically by aclock means 35. A timing signal for the local timebase tn is emittedafter each complete decrementation. Finally, the local synchronizationdevices 37 apply a correction value RR dyn, which is formed takingaccount of measured time discrepancies, as a new start value to therespective timer module 34. This results and in the desiredsynchronization of the local timebase tn to the central timebase tz. Thetimes 60, 61 and 62, respectively, in FIG. 2 may thus correspond tothose times at each of which a new start results. A reload value RR dyn,is loaded in the timer module 34 in the example in FIG. 1. In this case,this start value is not constant, but is dynamically adapted, byevaluation of the detected time discrepancies, for synchronization ofthe associated timebase tn. One advantageous embodiment of such dynamicadaptation is described in more detail in the following text withreference to the example in FIG. 6.

FIGS. 3 and 4 show examples of schematic flowcharts of the processingsteps which occur according to the invention between an associatedcommunication algorithm and synchronization algorithm in a dataprocessing apparatus. The illustrations in the figures serve to explainthe timing diagram in FIG. 2 further. In this case, FIG. 3 shows adetail from the processing steps, which occur successively andcyclically according to the present invention, between the centralsynchronization algorithm 9 and the central communication algorithm 8 atthe central data processing apparatus 2 end, i.e in the “CPU master”processing unit in FIG. 2. Furthermore, FIG. 4 shows a detail from theprocessing steps, which occur successively and cyclically according tothe present invention, between the local communication algorithm 36 andthe local synchronization algorithm 37 at the local data processingapparatus 15 end, i.e in the “CPU slave n” processing unit in FIG. 2.

In the example in FIG. 3, the central synchronization algorithm 9 isstarted by the processing step 39 at the action time 9 a, so that thisalgorithm generates a new time message Zn−1, and enters the temporarilystored transmission time x as a data value in this message. The centralcommunication algorithm 8 is started by the following processing step 40at the action time 8 a. This causes the time message Zn−1 to betransmitted to the data bus 10 in the processing step 8 aa, and itstransmission time y to be detected in the next processing step 8 ab. Thecentral synchronization algorithm 9 is started once again by the nextprocessing step 41. This receives the detected transmission time y, forstorage purposes. A first sequence of associated processing steps at thecentral data processing apparatus 2 end is terminated by this processingstep. The lower part of FIG. 3 shows two further cycles of processingsteps, which relate to the time messages Zn and Zn+1, in an analogousway to the content of FIG. 2. These sequences correspond to thepreviously explained sequence of processing steps, so that reference canbe made to what has been said above with regard to their more detaileddescription.

In the example in FIG. 4, the local communication algorithm 36 isstarted at an action time 36 a in a processing step 65. This start canbe initiated by the arrival of a time message on the data bus. In aprocessing step 36 aa, the local communication algorithm 36 then detectsnot only the time message Zn−1 that is present but also its actualreception time u. Furthermore, in the next processing step 36 ab, thetime message Zn−1 is decoded and reconstructed in such a way that atleast the value of the transmission time x contained in it for aprevious time message Zn−2 is recovered. The local synchronizationalgorithm 37 is started by the next processing step 66 at the actiontime 37 a. First of all, in a processing step 37 aa, this algorithmstores the reception time u associated with the time message Zn−1, forlater processing. In the next processing step 37 ab, a measured valuefor the time discrepancy between the central timebase and the localtimebase is determined from associated transmission and reception timesfor a time message.

In the illustrated example, the time discrepancy x-s is formed from thetransmission time x and the temporarily stored reception time s of thetime message Zn−2. In the timing diagram shown in FIG. 2, this timemessage was transmitted before the time message Zn−1, and is thus nolonger shown at the upper edge of the illustration, in order to make theillustration clearer. A correction value for synchronization of thelocal timebase tn can be determined from this time discrepancy x-s, andactivated. This will be explained in more detail in the following.

A first sequence of associated processing steps at the local dataprocessing apparatus 15 end is completed by this processing step. Thelower part of FIG. 4 likewise shows two further cycles of processingsteps, in an analogous way to the contents of FIG. 2, which relate tothe determination and processing of the time discrepancies u-y and v-zresulting from the evaluation of the time messages Zn−1 and Zn. Thesesequences correspond to the previously explained sequence of processingsteps, so that reference can be made to what has been said above withregard to their more detailed description.

According to a further, advantageous embodiment of the invention, alocal timebase in a local data processing apparatus determines andstores time discrepancies from the time messages transmitted during anobservation period. A predetermined number of transmissions of timemessages are in this case advantageously combined to form an observationperiod. The transmission and evaluation of a time message from anobservation period is also referred to in the following text as anobservation step. The minimum value occurring in each case is determinedfrom the accumulated time discrepancies detected in the observationperiod, and is used to form a correction value for use forsynchronization. As already mentioned above, a minimum value from agroup of time discrepancies is particularly suitable for forming acorrection value, since the dispatch, the transmission and the receptionof time messages linked to it have the smallest time difference from thecentral timebase. This will be explained further in the following textusing the example in FIG. 5.

By way of example, FIG. 5 shows an observation period which has 15observation steps, B1 to B16. In FIG. 5 there are two time axes, a firsttime axis 49 for the central timebase tz and a second time axis 52 forthe local timebase tn. The oblique position of the time axis for tn withrespect to the time axis for tz shows the discrepancy, or the drift,between the local timebase and the central timebase, which makes regularsynchronization of the local timebase necessary. The time axes 49, 52 inFIG. 5 correspond to those in FIG. 2. Furthermore, the respective timemarkers which are each indicated by a diamond at the end of eachobservation step in FIG. 5 correspond to the time markers on theright-hand, vertical time axis 49 in FIG. 2. This is made clear in FIG.5 by the reference symbols 59, 60, 61 and 62. By way of example, thetime messages Zn−2, Zn−1, Zn and Zn+1, respectively, are transmittedduring the observation periods B8, B9, B10 and B11, respectively. Inconsequence, the value of the time discrepancy x-s, u-y or v-z,respectively, is in each case available at the end, for example, of theobservation step B9, B10 or B11, respectively, i.e at the time markers60, 61 or 62, respectively. The value is that which has been obtained byevaluation of the time message Zn−2, Zn−1 and Zn, respectively. In theexample in FIG. 5, the minimum value of the time discrepancies in theillustrated observation period occurs, for example, at the end of theobservation step B13. Its advantageous further processing to form acorrection value for synchronization will be explained further using theexample in FIG. 6.

FIG. 6 shows, schematically, an exemplary embodiment of a localsynchronization algorithm in a local data processing apparatus in theform of a block diagram. Such an embodiment allows the determination andapplication of a correction value for the local timebase using theminimum value of the time discrepancies from the time messagestransmitted and evaluated within an observation period. In theillustration in FIG. 6, reference is in this case made, to assistunderstanding, to the block diagram in FIG. 1 and the localsynchronization algorithm 37, which is contained in the local dataprocessing apparatus 15 “slave n” there.

In this case, the processing steps of the synchronization algorithm 37illustrated symbolically in the blocks 72, 73 and 74 in FIG. 6 relate toone observation step in one observation period, and are run through onceagain in each observation step in the observation period.

In block 72, a first processing step 72 a is used to determine the valueof a time discrepancy, with the transmission time (which is transmittedwith the present time message) of a previous time message being checkedby means of a request 76 from the associated communication algorithm 36,and being processed by subtraction from the stored, associated receptiontime to form the value of a time discrepancy. The next processing step72 b is used to store this. A memory area 78 is illustrated symbolicallyin FIG. 6, for this purpose, in whose cells the already explained timediscrepancies x-s, u-y, v-z are entered, by way of example. The furtherprocessing step 72 c, whose object is to load a partial correctionvalue, will be explained in the following text.

This is followed by a block 73 with the processing steps 73 and 73 b. Inthis case, the object of the processing step 73 a is to store a presetvalue, namely the number of observation steps per observation period,which also corresponds to the number of runs of the synchronizationalgorithm 37 through the blocks 72, 73 and 74. The number of runs whichhave already taken place through these blocks are counted in the nextprocessing step 73 b. In the following program branch 74, the presetvalue from 73 a is compared with the present numerical value from 73 bto decide whether all the observation steps in an observation periodhave been processed. Thus, the comparison determines whether the end ofthe observation period has been reached, or whether there are still anyobservation steps to be processed. In the first case, the algorithmleaves the processing loop comprising the blocks 72, 73 and 74 and jumpsvia the branch 79 to the block 81. In the second case, it jumps back viathe branch 75 to the start of the processing loop, and the processing ofthe blocks 72, 73 and 74 is repeated for the next observation step.

After processing all the observation steps in an observation period, thepresent value of the minimum time discrepancy in the most recentobservation period is determined in the block 81, in which access ismade to the values contained in the memory area 78. According to aparticularly advantageous embodiment of the invention, which has alreadybeen illustrated in the example in FIG. 6, this minimum value can now beprocessed further with the aid of a control algorithm 84 in the localsynchronization algorithm 37, as far as the actual correction value RRdyn, which is emitted as the output value 85 from the control algorithm84. The control algorithm 84 advantageously includes a proportionalelement and, possibly, an integrating or differentiating element aswell. Furthermore, the control algorithm 84 is supplied with the valuezero as the set value 83 and with the minimum value of the timediscrepancies from a previous observation period as the actual value 82.

According to a further embodiment of the invention, a correction valuewhich has been determined by evaluating the observation steps in acompleted observation period can be applied in a distributed manner to alocal timebase during a subsequent observation period. For this purpose,a partial correction value is advantageously formed in the relevantlocal timebase by dividing a correction value by the predeterminednumber of time messages transmitted in each observation period, and apartial correction value is then applied to the local timebase forsynchronization, for each transmission of a time message, i.e for eachobservation step. The correction value is that not applied in one step,but in stages and extended over a period of time.

One advantageous embodiment which is suitable for this purpose haslikewise already been illustrated in the example in FIG. 6. To this end,the local synchronization algorithm 37 includes a block 87 which dividesthe correction value RR dyn at the output 85 of the control algorithm 84by the number of observation steps which have been read via the branch86 from the processing step 73 a. The partial correction value TK formedin this way can be applied to the local timebase in order to synchronizesaid local timebase for each transmission of a time message. In theexample in FIG. 6, a write process for the partial correction value TKis carried out by the block 88 in the synchronization algorithm 37, inwhich process this partial correction value TK is entered via the branch89 in the processing step 73 b in block 72. If the algorithm now onceagain runs cyclically through the processing loop comprising the blocks72, 73 and 74 in order to process the observation steps in a currentobservation period, then a partial correction value is applied to thelocal timebase for each run. After carrying out the intended number ofruns, the sum of all the partial correction values, that is to say thetotal correction value, is applied, so to speak, “softly”.

The application of a correction value is once again advantageouslycarried out using the local units, illustrated by way of example in FIG.1, for forming a local timebase tn. These unit includes a timer module34 which is decremented cyclically by a clock 35, and emits a timingsignal for the local timebase tn once a previously loaded start valuehas been completely decremented. For synchronization, the localsynchronization means, in particular the associated synchronizationalgorithm 37, apply the correction value RR dyn to the timer module 34as a new start value. If, as described above, the correction value issplit into partial correction values TK, then these are applied to thetimer module 34 in a subsequent observation period, preferably in timewith the reception of the time messages, and for each observation step.In the example shown in FIG. 6, this is symbolized by a branch 77 whichoriginates from the processing step 72 c and jumps to the timer module34.

1. A method for synchronization of at least one local timebase in alocal technical system to a central timebase in a central technicalsystem, with time messages being transmitted from the central timebaseto the local timebase, comprising: detecting the transmission time of atime message by the central timebase and entering the detectedtransmission time as a data value in a subsequent time message;detecting the reception time of a time message, and reproducing thevalue of the transmission time contained in a subsequent time message bythe local timebase; determining time discrepancies between the localtimebase and the central timebase by the local timebase, from adifference between associated transmission and reception times of timemessages; and evaluating values of the time discrepancies by the localtimebase, for synchronization of the local timebase, and determiningcorrection values for the local timebase therefrom.
 2. The method asclaimed in claim 1, further comprising: determining time discrepanciesby the local timebase in conjunction with a group of time messagestransmitted during an observation period; and forming a correction valueby the local timebase from a minimum value of the time discrepanciesdetermined in an observation period, and using the correction value forsynchronization.
 3. The method as claimed in claim 2, wherein thecorrection value corresponds to an initial value of a control algorithm,to which a value zero is supplied as a set value, and to which theminimum value of the time discrepancies determined during an observationperiod is supplied as an actual value when forming the correction value.4. The method as claimed in claim 3, wherein the correction value isapplied in a distributed manner to a local timebase during a subsequentobservation period.
 5. The method as claimed in claim 3, wherein theobservation period includes a predetermined number of transmitted timemessages, further comprising the steps of: forming a partial correctionvalue by division of the correction value by the predetermined number oftransmitted time messages, and applying the partial correction value tothe local timebase for synchronization for each transmission of a timemessage.
 6. The method as claimed in claim 4, wherein the observationperiod includes a predetermined number of transmitted time messages,further comprising the steps of: forming a partial correction value bydivision of the correction value by the predetermined number oftransmitted time messages, and applying the partial correction value tothe local timebase for synchronization for each transmission of a timemessage.
 7. The method as claimed in claim 2, wherein the correctionvalue is applied in a distributed manner to a local timebase during asubsequent observation period.
 8. The method as claimed in claim 7,wherein the observation period includes a predetermined number oftransmitted time messages, further comprising the steps of: forming apartial correction value by division of the correction value by thepredetermined number of transmitted time messages, and applying thepartial correction value to the local timebase for synchronization foreach transmission of a time message.
 9. The method as claimed in claim2, wherein the observation period includes a predetermined number oftransmitted time messages, further comprising the steps of: forming apartial correction value by division of the correction value by thepredetermined number of transmitted time messages, and applying thepartial correction value to the local timebase for synchronization foreach transmission of a time message.
 10. An apparatus comprising: acentral data processing device for forming a central timebase; centralcommunication means for supplying time messages to a data bus; centralsynchronization means for detecting the transmission time of a suppliedtime message and for entering it in a subsequent time message beforebeing supplied as a data value, and including at least one local dataprocessing device, the at least one local data processing deviceincluding, local means for forming a local timebase, local communicationmeans for receiving time messages from the data bus, and localsynchronization means for detecting the reception times of the receivedtime messages, for reading the transmission times contained in thereceived time messages, for determining time discrepancies between thelocal and the central timebase from associated transmission andreception times, and for determining a correction value for the localmeans from the determined time discrepancies in order to produce thelocal timebase.
 11. The apparatus as claimed in claim 10, wherein thelocal means each include a timer module in order to form a localtimebase, the timer module being decremented cyclically by a clock and,after complete decrementation of a start value, emitting a timing signalfor the local timebase; wherein local synchronization means applies thecorrection value to the respective timer module as the start value. 12.The apparatus as claimed in claim 11, wherein the local synchronizationmeans, forms the correction value from the time messages received in anobservation period. splits the correction value into partial correctionvalues, and applies these partial correction values to the timer modulein a subsequent observation period.
 13. The apparatus of claim 12,wherein the partial correction values are applied in time with thereception of time messages.
 14. The apparatus as claimed in claim 10,wherein the local synchronization means, forms the correction value fromthe time messages received in an observation period, splits thecorrection value into partial correction values, and applies thesepartial correction values to the timer module in a subsequentobservation period.
 15. The apparatus of claim 14, wherein the partialcorrection values are applied in time with the reception of timemessages.
 16. An apparatus, for use in a production facility, comprisingthe apparatus of claim 10, wherein the production facility includes alocal data processing device which actuates local technical equipment intime with the respective local timebase.
 17. The apparatus for use in aproduction facility as set forth in claim 16, wherein the productionfacility includes electrical drives as the technical equipment.
 18. Theapparatus of claim 17, wherein the local data processing deviceinterchanges control variables, with the associated local technicalequipment, in synchronism with the respective local timebase.
 19. Theapparatus of claim 16 wherein the local data processing deviceinterchanges control variables with the associated local technicalequipment, in synchronism with the respective local timebase.